package ru.incoremedia.gwttest.core.server.i18n;

import java.util.Locale;
import javax.validation.MessageInterpolator;


public class MyMessageInterpolator implements MessageInterpolator {

    private final MessageInterpolator defaultInterpolator;

    private final Locale locale;

    public MyMessageInterpolator(MessageInterpolator defaultInterpolator, Locale locale) {
        this.defaultInterpolator = defaultInterpolator;
        this.locale = locale;
    }

    @Override
    public String interpolate(String messageTemplate, Context context) {
        return defaultInterpolator.interpolate(messageTemplate, context, locale);
    }

    @Override
    public String interpolate(String messageTemplate, Context context, Locale locale) {
        return defaultInterpolator.interpolate(messageTemplate, context, locale);
    }
}
